package main
import (
    "encoding/json"
    "fmt"
    "os"
    
)
type BinStruct struct{
	FileName string
    Addr uint32
}

type Cfg struct {
   	Manufacturers uint32
    Product uint32
    Boot BinStruct
    App0 BinStruct
}

var UserCfg Cfg

func main() {
    cfile := "config.json"
    fd, err := os.Open(cfile)
	if err != nil {
		fmt.Println("open configuration file faild")
		os.Exit(1)
	}
    defer fd.Close()
    decoder := json.NewDecoder(fd)
    err = decoder.Decode(&UserCfg)
    if err != nil {
        fmt.Println("Error:", err)
    }
   
}